package o;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public final class aui extends ato<Object> {
    public static final ats ॱ = new ats() {
        public <T> ato<T> ˎ(atb o_atb, auv<T> o_auv_T) {
            if (o_auv_T.ˋ() == Object.class) {
                return new aui(o_atb);
            }
            return null;
        }
    };
    private final atb ˋ;

    aui(atb o_atb) {
        this.ˋ = o_atb;
    }

    public Object ˏ(auy o_auy) throws IOException {
        switch (o_auy.ʻ()) {
            case BEGIN_ARRAY:
                List arrayList = new ArrayList();
                o_auy.ˊ();
                while (o_auy.ˋ()) {
                    arrayList.add(ˏ(o_auy));
                }
                o_auy.ˎ();
                return arrayList;
            case BEGIN_OBJECT:
                Object o_atz = new atz();
                o_auy.ॱ();
                while (o_auy.ˋ()) {
                    o_atz.put(o_auy.ᐝ(), ˏ(o_auy));
                }
                o_auy.ˏ();
                return o_atz;
            case STRING:
                return o_auy.ʽ();
            case NUMBER:
                return Double.valueOf(o_auy.ॱˊ());
            case BOOLEAN:
                return Boolean.valueOf(o_auy.ʼ());
            case NULL:
                o_auy.ॱॱ();
                return null;
            default:
                throw new IllegalStateException();
        }
    }

    public void ˎ(aux o_aux, Object obj) throws IOException {
        if (obj == null) {
            o_aux.ᐝ();
            return;
        }
        ato ˋ = this.ˋ.ˋ(obj.getClass());
        if (ˋ instanceof aui) {
            o_aux.ˊ();
            o_aux.ˏ();
            return;
        }
        ˋ.ˎ(o_aux, obj);
    }
}
